UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GbZ1rwzyKhjmDOFqxQbT3sKVy6twP3rhchKNwGYcrjM='
WHERE
key_id = '021ec8354775c4d923d83318c8bc19a4bb772f8cd03aec8aeabdab432fabe94d'
AND (
token = 'GbZ1rwzyKhjmDOFqxQbT3sKVy6twP3rhchKNwGYcrjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)