UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6MHeeo1XfYqtF73EWOp5wRo0pxIl3deMt6cLLGLd5K0='
WHERE
key_id = '6bffaf833211a9a8279d018e490f63b34e8c4eb795bcb97c1627b43bc53614da'
AND (
token = '6MHeeo1XfYqtF73EWOp5wRo0pxIl3deMt6cLLGLd5K0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)