UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7MvT77JXqHyHQg5lV1vjxeWTwslNwNJ/9N10jJdDqis=' 
WHERE 
  key_id = '868fb6ff024f3ae5ee9d017a092631f5a9af2a1a6dc14abd2dc9d5d7854e5c07' 
  AND (
    token = '7MvT77JXqHyHQg5lV1vjxeWTwslNwNJ/9N10jJdDqis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029