UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RyYfX4NpZciNukgnNDGIhONzcfZEQn/JTYp4Rd/Q9bE=' 
WHERE 
  key_id = '241b1f585549cb7288ba3026d1b6ce683430d19522ce968c9b0701c7765dbcc3' 
  AND (
    token = 'RyYfX4NpZciNukgnNDGIhONzcfZEQn/JTYp4Rd/Q9bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024