UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmmj7/K3Z4hbSb+Z24tH3OYMe1dC2l0aYG2hQaFM6q8=' 
WHERE 
  key_id = '744e3335128cd786c16d41701cbf6cbd100bf64399d142f7bb4ad5903b7a78e1' 
  AND (
    token = 'zmmj7/K3Z4hbSb+Z24tH3OYMe1dC2l0aYG2hQaFM6q8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015