UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wXEX9hLZYzb5u3u7R4n+/DLplb//CIsKYz/MUvLKGH0='
WHERE
key_id = '87dcd55bbad1640d93800123551c2e9b39759aca87b09e7513c8d4b4b0c69e1b'
AND (
token = 'wXEX9hLZYzb5u3u7R4n+/DLplb//CIsKYz/MUvLKGH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)