UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v2jUKDWx5iHKPUP5u4zQZtfuUvE3W1FUKfn02jDNsVc='
WHERE
key_id = 'f19b4df5e19aa3bd1e4ef7810e2c2cc2feab2042ebe40e486a79e06c40b6202c'
AND (
token = 'v2jUKDWx5iHKPUP5u4zQZtfuUvE3W1FUKfn02jDNsVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)