UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IrBUH71BImsQ4whJJIkLweB3+d6p7d8Kc/wQPA6AOYk=' 
WHERE 
  key_id = '464f9e9ed3e004a466655df7557c92b0faf5c6859d7eb90136a687e90b767b7c' 
  AND (
    token = 'IrBUH71BImsQ4whJJIkLweB3+d6p7d8Kc/wQPA6AOYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020