UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OCCnR06whXWxhWURasnMjVKgWiczgwUVqqX0oKYDYak=' 
WHERE 
  key_id = '48346f3b25b3cdb3b84a247009bf1e1061ac578b9ae9009f7555fdb4204f0e29' 
  AND (
    token = 'OCCnR06whXWxhWURasnMjVKgWiczgwUVqqX0oKYDYak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062