UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KzpGHbxPiizpSOrulFqA4rcPJRP0NXxo3jLbynRwK9A='
WHERE
key_id = 'f4343dbed8c2481c5a609be9cca258c08121f0e339032c05c14ee37ca01e3486'
AND (
token = 'KzpGHbxPiizpSOrulFqA4rcPJRP0NXxo3jLbynRwK9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)