UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zgK99bV1jQ+ILctsO+4SpoS9lrI6/qUBVYbz6RT+APo='
WHERE
key_id = 'fcca953e3539e21e1a0c4a888c93585c2df3e0b34ca3dd4098ee274d74086b21'
AND (
token = 'zgK99bV1jQ+ILctsO+4SpoS9lrI6/qUBVYbz6RT+APo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)