UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXC9XDI95CRaueH9fXkgpa5Lt4M+0MZvT73K0O0ml7Y='
WHERE
key_id = '8f58bc1264ddd07a212f8873709683fb11b073291ab122275b50a4ba6938d00c'
AND (
token = 'nXC9XDI95CRaueH9fXkgpa5Lt4M+0MZvT73K0O0ml7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)