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