UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nMxUB2NI2QCvUjs1fGEmNY2kQrHeu/v4RZUH5UFaWOc='
WHERE
key_id = '8c1820e58b499ff4c847cf9dbb5884678f1365c6cf54fcfb1f4a3a23c3b41cfc'
AND (
token = 'nMxUB2NI2QCvUjs1fGEmNY2kQrHeu/v4RZUH5UFaWOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)