UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sRNBMFq9AWYvlRDSq4Ai6+Ozdw+Oh4WyoAtsN2hQfEA=' 
WHERE 
  key_id = 'db94c7a40f7b2af985ac70b297f865c5d3fff15b5cbe6eb25d12f10dad81e805' 
  AND (
    token = 'sRNBMFq9AWYvlRDSq4Ai6+Ozdw+Oh4WyoAtsN2hQfEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044