UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vqCUQbrHVwVI4M436MH74Vv2y3SA+eUpVRIIthHLFzs=' 
WHERE 
  key_id = '4a884ad98e34eae866a5d9cfdbcc0b44dfea4b9638cc9cb4d1e6c0ce92963f5d' 
  AND (
    token = 'vqCUQbrHVwVI4M436MH74Vv2y3SA+eUpVRIIthHLFzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043