UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JkDHAr2uw4suK3dIlrtYCd59Vvf2GpZDVeXYGyDepRM='
WHERE
key_id = 'cf2cf18b4c2bfd172c65f8ead8bd01da994d0fbd9337491b96be5502044031fe'
AND (
token = 'JkDHAr2uw4suK3dIlrtYCd59Vvf2GpZDVeXYGyDepRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)