UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L1DStv9O56oeaqQ66Uzs/nUrVkD0yaglDPnv3v6ivWU='
WHERE
key_id = '054126f26e538a84bffab3b50e5fb0982e046af9606294c6578ed17a4f8b37c0'
AND (
token = 'L1DStv9O56oeaqQ66Uzs/nUrVkD0yaglDPnv3v6ivWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)