UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aCxAAL6LiA5k43pRyIFTesq2y69rddrXaoST07daIdM='
WHERE
key_id = '8b54700fbf5350a013426bae0f6d44f4c31979eb8708d781313c88655d946f88'
AND (
token = 'aCxAAL6LiA5k43pRyIFTesq2y69rddrXaoST07daIdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)