UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pF6dT7r2A1ZuVikDuwYAm7OlhqigGAVBMNCXjZzQmo='
WHERE
key_id = 'fa104692d75475478970da0c328b6b58c465b10087198ad3f878042ac7e02965'
AND (
token = '4pF6dT7r2A1ZuVikDuwYAm7OlhqigGAVBMNCXjZzQmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)