UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '++mXUuCDR4kxJUWh2HV7jCH3go3SE+VdIna7FLpMtVs='
WHERE
key_id = '16215cdb01f02c677cc0dee0fa6d702a15180c74d06ab6439967eea638eb657e'
AND (
token = '++mXUuCDR4kxJUWh2HV7jCH3go3SE+VdIna7FLpMtVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)