UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1MDPVn082xQy0vjjLgtGOBJoC0Pg8eoXNHhFkZWT8A8='
WHERE
key_id = '7e5d0dd6e709e4aa5813f703c8f6906f18dc5a0bac92436d8d9746c20c4f1692'
AND (
token = '1MDPVn082xQy0vjjLgtGOBJoC0Pg8eoXNHhFkZWT8A8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)