UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C6HI/QvasdODBS6bsRvafXIjvdxA1bq1lPbpRQHNKoQ='
WHERE
key_id = 'ab1f1209ff91a6ccc769b419b9583c645ea10b42cffb8f60d8de940e41a93400'
AND (
token = 'C6HI/QvasdODBS6bsRvafXIjvdxA1bq1lPbpRQHNKoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)