UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ePHgOB0KAZQfRkLpZPnK76MutWU0tnkbxyDYH52nwc='
WHERE
key_id = '377b9a1b91d10e2fef1f36951d43303b9fe369f2ca282e92e5273490105edff2'
AND (
token = '9ePHgOB0KAZQfRkLpZPnK76MutWU0tnkbxyDYH52nwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)