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

Query time 0.00030