UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3U00VuhOkA7f7eQtU6xwRS2BvOxWI6/4jkS9SZTaJk=' 
WHERE 
  key_id = 'eef88b89e1ee5ecef988b5b534a4043be9c66740b6fa7273e308f35a60e8fad5' 
  AND (
    token = 'Y3U00VuhOkA7f7eQtU6xwRS2BvOxWI6/4jkS9SZTaJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051