UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dmv/KkMY8xhI3fGbblHUkHvGxVM5n2SNFEfOho8s/1o='
WHERE
key_id = '99e32ab610ee3bbff8fde7a800e9da3490c156c2fd54bb37d6a144fbca5f0b6e'
AND (
token = 'dmv/KkMY8xhI3fGbblHUkHvGxVM5n2SNFEfOho8s/1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)