UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDUS+cR4ZIpGVlJeHD1MEzDvsG+/Dzy4Vw7xGQ0Gx+A='
WHERE
key_id = '97d0f444bb73c0c867a048ffb5a2d8e6318b79db61334fa2106a05cbc5f252e9'
AND (
token = 'GDUS+cR4ZIpGVlJeHD1MEzDvsG+/Dzy4Vw7xGQ0Gx+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)