UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iEIP4wB+IJ1JNcUEqdyBLSphIGc5cdSupMDDyeRoF9U='
WHERE
key_id = '3624182006bcb48741e2b61e1eb507e18658d4d5b58f8dc3f3d27fa9b764b807'
AND (
token = 'iEIP4wB+IJ1JNcUEqdyBLSphIGc5cdSupMDDyeRoF9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)