UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z9dgWYBNbVvJ/bGftKMukYugrLYqG6syHBJF0zC3j60='
WHERE
key_id = 'eb0da65e5653078bd2ae6ab68826229f124a8ebea008e4ff80448ebfae9a43f7'
AND (
token = 'z9dgWYBNbVvJ/bGftKMukYugrLYqG6syHBJF0zC3j60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)