UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zjl3bIbr4/woC5ZWcPV/roeevQ4btSCHYbY9ZnE0vsU='
WHERE
key_id = 'b0634489f856ddd18aebe8ad793a8bd7766352e033f04a71c1ae33960948e11a'
AND (
token = 'Zjl3bIbr4/woC5ZWcPV/roeevQ4btSCHYbY9ZnE0vsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)