UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XHfvrZ8m3Swj3dz5xi5dx92mK1uGsGabtSaq9llIWhk='
WHERE
key_id = '7a8d8c5dce3a8545f17809918c6a0e531c795deb5713760003bb50ff25b6c028'
AND (
token = 'XHfvrZ8m3Swj3dz5xi5dx92mK1uGsGabtSaq9llIWhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)