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