UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rsc/sObQSMsIAssLrKiG1ICgaBE8aGcClVIRcKXIj0Q=' 
WHERE 
  key_id = 'b0e84212293f53234d4f7de7d3e82fc68fadc3aa9ef74ed8a747c828848f1d65' 
  AND (
    token = 'Rsc/sObQSMsIAssLrKiG1ICgaBE8aGcClVIRcKXIj0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022