UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7hE76vhbznX7HdLArTN8Phu3uJ+DrsF4hPq1tBkBhck=' 
WHERE 
  key_id = 'e3daf820c85d4efa6e02c55b358a254d8dd60d00a3b3021b45bd3135d92fd79f' 
  AND (
    token = '7hE76vhbznX7HdLArTN8Phu3uJ+DrsF4hPq1tBkBhck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021