UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oMmf+GyAiRtt/ZuKnS9sA9Ax4GU+ihkuNQ4KybNCjTU='
WHERE
key_id = 'e306cc02068b5b7c3c3d9f789e092b654310a246a8ced67c034db86d4fb62d32'
AND (
token = 'oMmf+GyAiRtt/ZuKnS9sA9Ax4GU+ihkuNQ4KybNCjTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)