UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxafeeOmH31WlLjjutHkY8JnieCczHZZQh3rCiXRnoQ='
WHERE
key_id = '388852ecf63c3d2fa2fda3ad74f16554985f387eaf5c9b46918ba85478ae8906'
AND (
token = 'bxafeeOmH31WlLjjutHkY8JnieCczHZZQh3rCiXRnoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)