UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nqfpRlcTAyXyk5OZ1oTPHTM7Sst1Kf3u/BnnqnLkBhY=' 
WHERE 
  key_id = '7193391de6cb8f367db80e1b46432ae83b152eb2488a8ad01b45d73b48acca6f' 
  AND (
    token = 'nqfpRlcTAyXyk5OZ1oTPHTM7Sst1Kf3u/BnnqnLkBhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040