UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z5s4OPZsBGAt6pl2M8Gb5q721VgM/ihjumdW6JCoxLQ='
WHERE
key_id = '33328e88426c9f46d3642ac557bfcfa26f8bc03cc023d9a83ab259b6eab7aca8'
AND (
token = 'z5s4OPZsBGAt6pl2M8Gb5q721VgM/ihjumdW6JCoxLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)