UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p9wL/4+3295qQfFbjn1p4BVy433tiYkslyzBI2TTChY='
WHERE
key_id = '7a8a736d061baeab23969ce4393cf455292ccbd630f0aa4b1b27d888bc7fb814'
AND (
token = 'p9wL/4+3295qQfFbjn1p4BVy433tiYkslyzBI2TTChY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)