UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KXHLIqH2V7aHB/zx5n+ChfZJy3DUH6TnzAJOdtVvRd8=' 
WHERE 
  key_id = 'adaa05bb3a5fd966bfa20b2037503e59f7e73cf4809a611c434e92e9e3c199db' 
  AND (
    token = 'KXHLIqH2V7aHB/zx5n+ChfZJy3DUH6TnzAJOdtVvRd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053