UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wode+2YifUeQRfCuXRg5GMIFY2bLwg3k8rUWEaAm2Eg='
WHERE
key_id = '09a29cb6888a6f9da33848669593697ff7f841dbafba7f42caeae118f01639a3'
AND (
token = 'wode+2YifUeQRfCuXRg5GMIFY2bLwg3k8rUWEaAm2Eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)