UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tbqyw/6ApiHgmGYqlgyB1/J2aECR1IeGFOFO1zqb8J4=' 
WHERE 
  key_id = '80b600522cd3e6385ce7bb982ae834533280233b3e8a853f66f28ffaa47b7f23' 
  AND (
    token = 'Tbqyw/6ApiHgmGYqlgyB1/J2aECR1IeGFOFO1zqb8J4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021