UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eY0fILBcWrAKC3jBccIRIQbOozaEjRAg+iz0Dmad/NY='
WHERE
key_id = '55cd076ab6288ab65df4830fad7764fea9a3ac7b091638fb18b5415ea4215e4f'
AND (
token = 'eY0fILBcWrAKC3jBccIRIQbOozaEjRAg+iz0Dmad/NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)